package vn.sms.vsms;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;

import vn.sms.vsms.provider.DbHelper;
import android.app.Application;
import android.database.sqlite.SQLiteDatabase;

public class GlobalApplication extends Application {
	private static DbHelper _db = null;
	private static Application _application;
	
	public static Application _()
	{

		return _application;
	}
	
	public GlobalApplication()
	{
		_application = this;
	}
	
	@Override
	public void onCreate() {
		// TODO Auto-generated method stub
		super.onCreate();
		
		if(_db == null){
			_db = new DbHelper(GlobalApplication._());
			_db.getWritableDatabase(); 
		}
		
		
	}
	
	
	
	public static synchronized SQLiteDatabase  getDb(){
		 
		return _db.getWritableDatabase(); 
	}
	



	
	
}
